import Vue from 'vue'
import Router from 'vue-router'
const indexPage = r => require.ensure([], () => r(require('../view/index.vue')))
const testPage = r => require.ensure([], () => r(require('../view/test.vue')))
Vue.use(Router)

var router = new Router({
  routes: [
    {
      path: '/',
      redirect: to => {
        return '/index'
      }
    },
    {
      path: '/index',
      name: 'index',
      components: {
        view: indexPage
      }
    },
    {
      path: '/test',
      name: 'test',
      components: {
        view: testPage
      }
    },
  ]
})

export default router